add debian patch matplotlib_nullptr_s390x.patch
authorDrew Parsons <dparsons@debian.org>
Thu, 5 Feb 2026 17:28:24 +0000 (18:28 +0100)
committerDrew Parsons <dparsons@debian.org>
Thu, 5 Feb 2026 17:30:40 +0000 (18:30 +0100)
handles case of null ScalarPointer in image in
vtkMatplotlibMathTextUtilities::RenderOneCell

A null pointer was generated on s390x causing pyvista
test_add_text_latex to segfault.

See upstream #19931
https://gitlab.kitware.com/vtk/vtk/-/issues/19931

Closes: #1126861
debian/changelog
debian/patches/matplotlib_nullptr_s390x.patch [new file with mode: 0644]
debian/patches/series

index 6fd1ba51bc99bf5a36dc7796cd1af8ae5bbf82a4..b07139269c7e4ca4fdc8ac1f089265419e319bbf 100644 (file)
@@ -1,3 +1,12 @@
+vtk9 (9.5.2+dfsg3-6) UNRELEASED; urgency=medium
+
+  * debian patch matplotlib_nullptr_s390x.patch handles case of null
+    ScalarPointer in image in vtkMatplotlibMathTextUtilities::RenderOneCell
+    A null pointer was generated on s390x causing pyvista
+    test_add_text_latex to segfault. Closes: #1126861
+
+ -- Drew Parsons <dparsons@debian.org>  Thu, 05 Feb 2026 18:20:15 +0100
+
 vtk9 (9.5.2+dfsg3-5) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/matplotlib_nullptr_s390x.patch b/debian/patches/matplotlib_nullptr_s390x.patch
new file mode 100644 (file)
index 0000000..0909300
--- /dev/null
@@ -0,0 +1,17 @@
+Index: vtk9/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx
+===================================================================
+--- vtk9.orig/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx  2026-01-25 23:22:22.741023671 +0100
++++ vtk9/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx       2026-02-05 12:10:11.414134274 +0100
+@@ -1029,6 +1029,12 @@
+     {
+       unsigned char* ptr = static_cast<unsigned char*>(image->GetScalarPointer(col, row, 0));
++      if (ptr == nullptr)
++      {
++      vtkErrorMacro("image returned null ScalarPointer.");
++      return false;
++      }
++
+       // Background, do not load python data
+       if (row > pythonRowStart || col < pythonColStart || row <= pythonRowEnd ||
+         col >= pythonColEnd)
index 70678eba9d0ff6c3e2b7cfa320bc521ad71ab33d..e6c09e9e6c2bc69a80ebc32e28427d4c2ce6336c 100644 (file)
@@ -12,3 +12,4 @@
 100_add_missing_gl_header.patch
 121_add_support_for_loong64.patch
 findEXPAT_version_fix_MR12826.patch
+matplotlib_nullptr_s390x.patch